<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 판매 게시판 목록 페이지 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>판매 게시판</title>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="${initParam.root}jquery-1.9.1.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#sellWriteBtn").click(function(){
			location.href="${initParam.root}sell.do?command=getWriteView";
		});//sellWriteBtn click
	});//ready
</script>
</head>

<h3>판매 게시판</h3>

<!-- 게시판 -->
<table border=3>
	<thead>
		<tr><td>글번호</td><td>글제목</td><td>판매자</td><td>작성시간</td><td>조회수</td></tr>
	</thead>
	<tbody>
		<c:forEach items="${requestScope.lvo.list}" var="list">	
			<tr><td>${list.sellNo}</td><td>[${list.sellStatus}]
			<a href="sell.do?command=showContent&sellNo=${list.sellNo}">${list.title}</a></td>
			<td>${list.mvo.id }(${list.mvo.name })</td><td>${list.timePosted}</td>
			<td>${list.hits}</td></tr>
		</c:forEach>
	</tbody>
</table> <br>
<input type="button" id="sellWriteBtn" value="글쓰기"> <br><br>

<!-- PagingBean 처리한 태그. 위에서부터 이전페이지 버튼, 페이징 넘버, 그리고 다음페이지 버튼을 나타낸다. -->
<c:if test="${requestScope.lvo.pagingBean.previousPageGroup}">
	<a href="sell.do?command=getContentList&pageNo=${requestScope.lvo.pagingBean.startPageOfPageGroup-1}">
		<img src="img/left_arrow_btn.gif">
	</a>
</c:if>
<c:forEach begin="${requestScope.lvo.pagingBean.startPageOfPageGroup}"
end="${requestScope.lvo.pagingBean.endPageOfPageGroup}" step="1" var="pageNo">
	<a href="sell.do?command=getContentList&pageNo=${pageNo}">${pageNo}</a>
</c:forEach>
<c:if test="${requestScope.lvo.pagingBean.nextPageGroup}">
	<a href="sell.do?command=getContentList&pageNo=${requestScope.lvo.pagingBean.endPageOfPageGroup+1}">
		<img src="img/right_arrow_btn.gif">
	</a>
</c:if>

